//
//  XDownloadModel.m
//  DownloaderTest
//
//  Created by user on 2018/6/13.
//  Copyright © 2018年 Dnake. All rights reserved.
//

#import "XDownloadModel.h"

@implementation XDownloadModel

- (NSString *)filePath {
    if (!_filePath) {
        NSString *fileName = [_url substringFromIndex:[_url rangeOfString:@"/" options:NSBackwardsSearch].location + 1];
        NSString *str = [NSString stringWithFormat:@"_%@", fileName];
        _filePath = [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:str];
    }
    
    return _filePath;
}

@end
